﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void SList()
{
	SLTNode* plist = NULL;
	//打印
	//SLTPrint(plist);
	//尾部插⼊
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);

	//SLTPushFront(&plist, 1);
	//SLTPushFront(&plist, 2);
	//SLTPushFront(&plist, 3);
	//SLTPushFront(&plist, 4);
	//SLTPrint(plist);

	//SLTPopBack(&plist);
	//SLTPrint(plist);

	//SLTPopFront(&plist);
	//SLTPrint(plist);

	SLTNode* find = SLTFind(plist, 2);
	//if (find==NULL)
	//{
	//	printf("未找到！\n");
	//}
	//else
	//{
	//	printf("找到了！\n");
	//}

	/*SLTInsert(&plist, find, 9);
	SLTPrint(plist);*/

	
	/*SLTInsertAfter(find, 78);
	SLTPrint(plist);*/

	//SLTErase(&plist, find);
	//SLTPrint(plist);

	/*SLTEraseAfter(find);
	SLTPrint(plist);*/

	//销毁链表
	SListDestroy(&plist);
	SLTPrint(plist);
}

int main()
{
	SList();
	return 0;
}